﻿using TaoSH.AppCode;
using TaoSH.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaoSH.View
{
    public partial class DDCL : FormUControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 重写父类的保存数据方法
        /// </summary>
        /// <param name="intFormID">数据ID</param>
        /// <param name="strActionType">操作类型("ADD":"添加","UPDATE":"修改")</param>
        /// <returns></returns>
        public override bool SaveForm(int intFormID, string strActionType)
        {
            //执行 父类的方法

            //保存数据
            PT_Order_Header Model = new TaoSH.AppCode.PT_Order_HeaderB().GetEntity(d => d.OrderID == intFormID.ToString());
            Model.Receiver = txtJSR.Text;
            Model.Telephone = txtLXDH.Text;
            Model.Province = hids1.Value;
            Model.City = hids2.Value;
            Model.County = hids3.Value;


            Model.Address = txtXXDZ.Text;
            Model.Express = txtKDGS.Text;
            Model.ExpressNo = txtKDDH.Text;
            return new TaoSH.AppCode.PT_Order_HeaderB().Update(Model);
        }




        public override void initMangerForm(int intFormID)
        {
            base.initMangerForm(intFormID);
            PT_Order_Header Model = new TaoSH.AppCode.PT_Order_HeaderB().GetEntity(d => d.OrderID == intFormID.ToString());



            hids1.Value = Model.Province;
            hids2.Value = Model.City;
            hids3.Value = Model.County;


            txtJSR.Text = Model.Receiver;
            txtLXDH.Text = Model.Telephone;

            txtXXDZ.Text = Model.Address;
            txtKDGS.Text = Model.Express;

            txtKDDH.Text = Model.ExpressNo;


            txtDDHM.Text = Model.OrderID;

            txtZJE.Text = Model.PayPrice.ToString();
            txtYFJE.Text = Model.PayPrice.ToString();
        }


    }
}